<template>
  <Layout>
    <Form ref="form1" :model="form1" :label-width="120">
      <Row class="query-form" style="padding-top: 15px">
        <Col span="8">
          <FormItem label="被审计单位：">
            <!--            <cascaderDom ref="childOrg" @setOrgname="(orgName)=>form1.auditedOrgName = orgName"
                                     class="query-form-el"
                                     :orgTree="true"></cascaderDom>-->
            <company-select root v-model="form1.auditedOrgName" class="query-form-el"></company-select>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="审计计划：">
            <Select v-model="form1.auditPlanId" style="width: 95%">
              <Option v-for="plan in planList" :key="plan.auditPlanId" :value="plan.auditPlanId">
                {{ plan.auditPlanName }}
              </Option>
            </Select>
          </FormItem>
        </Col>
        <Col span="8" v-if="switchFlag">
          <FormItem label="所属二级集团：" prop="order">
            <two-level-org org-code class="query-form-el" v-model="form1.twoLevelOrgId"></two-level-org>
          </FormItem>
        </Col>


        <Col span="8" v-if="!switchFlag">
          <Button @click="switchQuery(true)" class="ivu-btn-switch" type="text">展开∨</Button>
          <Button @click="reset" class="ivu-btn-reset">重置</Button>
          <Button class="ivu-btn-query" icon="md-search" @click="query">查询</Button>
        </Col>
      </Row>
      <Row v-show="switchFlag" class="query-form" style="padding-top: 15px">

        <Col span="8">
          <FormItem label="组长姓名：">
            <Input class="query-form-el" type="text" v-model="form1.groupLeaderName"></Input>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="审计状态：">
            <Select v-model="form1.auditState" style="width: 95%">
              <Option value="0">审计中</Option>
              <Option value="1">已审计</Option>
            </Select>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="带队姓名：">
            <Input class="query-form-el" type="text" v-model="form1.supervisor"></Input>
          </FormItem>
        </Col>
      </Row>
      <Row v-show="switchFlag" class="query-form" style="padding-top: 15px">

        <Col span="8">
          <FormItem label="审计任务：">
            <Input class="query-form-el" type="text" v-model="form1.missionName"></Input>
          </FormItem>
        </Col>
        <Col span="8" offset="8">
          <Button @click="switchQuery(false)" class="ivu-btn-switch" type="text">收起∧</Button>
          <Button @click="reset" class="ivu-btn-reset">重置</Button>
          <Button class="ivu-btn-query" icon="md-search" @click="query">查询</Button>
        </Col>

      </Row>


      <Row class="query-form"
           v-if="this.currentUser.loginId === this.Common.admin ||this.crrentUser.userRole.find(obj => obj.roleId == 'dda573b123f9472d95ba3063b25133f7') != undefined">
        <Col span="24">
          <Button size="large" class="ivu-btn-add" @click="rollback" :loading="backLoading">审计任务退回</Button>
        </Col>
      </Row>
    </Form>

    <Table ref='table' :height="tableHeight" no-data-text="没有查询到相关数据！" @on-selection-change="reportSelect"
           @on-sort-change="sortChange"
           :loading="buttonLoading" size="small" border :columns="columns1" :data="dataTable">
    </Table>
    <Row style="margin-right:10px;">
      <Col span="24">
        <Page :total="pagedata.total" :page-size="pagedata.pageSize" @on-change="pageChange"
              style="float: right" @on-page-size-change="pageSizeChange" :page-size-opts="pageSizeArray"
              show-total show-sizer show-elevator/>
      </Col>
    </Row>
    <Modal :title="add?'审计任务新增':'审计任务修改'" :transfer=false v-model="model1" :width=600>
      <Form ref="f1" :model="form1datacopy" :rules="ruleCustom" label-position="top">
        <Row type="flex" justify="space-around" class="code-row-bg">
          <Col span="11">
            <FormItem label="审计任务：" prop="missionName">
              <Input type="text" v-model=" form1datacopy.missionName" readonly/>
            </FormItem>
          </Col>


          <Col span="11">
            <FormItem label="审计计划：">
              <Input type="text" v-model=" form1datacopy.auditPlanName" readonly/>
            </FormItem>
          </Col>
        </Row>
        <Row type="flex" justify="space-around" class="code-row-bg">
          <Col span="11">
            <FormItem label="审计基础标准：" prop="basicsId">
              <Select class="query-form-el" v-model="form1datacopy.basicsId" style="width: 100%;" clearable>
                <Option v-for="item in basics" :value="item.id" :key="item.id">{{ item.auditName }}</Option>
              </Select>
            </FormItem>
          </Col>
          <Col span="11">
            <FormItem label="审计现场标准：" prop="sceneId">
              <Select class="query-form-el" v-model="form1datacopy.sceneId" style="width: 100%;" clearable>
                <Option v-for="item in scene" :value="item.id" :key="item.id">{{ item.auditName }}</Option>
              </Select>
            </FormItem>
          </Col>
        </Row>
        <Row type="flex" justify="space-around" class="code-row-bg">
          <Col span="11">
            <FormItem label="审计班组标准：" prop="teamId">
              <Select class="query-form-el" v-model="form1datacopy.teamId" style="width: 100%;" clearable>
                <Option v-for="item in teams" :value="item.id" :key="item.id">{{ item.auditName }}</Option>
              </Select>
            </FormItem>
          </Col>
          <Col span="11">
            <FormItem label="审计类型：" prop="auditType">
              <Select class="query-form-el" style="width: 100%;" v-model="form1datacopy.auditType" disabled>
                <Option value="1">专项检查</Option>
                <Option value="2">安全审计</Option>
              </Select>
            </FormItem>
          </Col>
        </Row>
        <Row type="flex" justify="space-around" class="code-row-bg">
          <Col span="11">
            <FormItem label="被审计单位：" prop="auditedOrgId">
              <Input type="text" v-model=" form1datacopy.auditedOrgName" readonly/>
            </FormItem>
          </Col>
          <Col span="11">
            <FormItem label="带队：" prop="supervisorId">
              <Input type="text" v-model=" form1datacopy.supervisor" readonly/>
            </FormItem>
          </Col>

        </Row>
        <Row type="flex" justify="space-around" class="code-row-bg">
          <Col span="11">
            <FormItem label="组长：" prop="groupLeaderName">
              <Input type="text" v-model="form1datacopy.groupLeaderName" readonly/>
            </FormItem>
          </Col>
          <Col span="11">
            <FormItem label="组员：" prop="membersName">
              <Input type='text' v-model='form1datacopy.membersName' readonly></Input>
            </FormItem>
          </Col>

        </Row>
        <Row type="flex" justify="space-around" class="code-row-bg">

          <Col span="11">
            <FormItem label="开始时间：" prop="planStart">
              <DatePicker class="query-form-el" type="date" style="width: 100%;" v-model="form1datacopy.planStart"
                          format="yyyy-MM-dd" placeholder="请选择" readonly></DatePicker>
            </FormItem>
          </Col>
          <Col span="11">
            <FormItem label="结束时间：" prop="planEnd">
              <DatePicker type="date" class="query-form-el" style="width: 100%;" v-model="form1datacopy.planEnd"
                          format="yyyy-MM-dd" placeholder="请选择" readonly></DatePicker>
            </FormItem>
          </Col>
        </Row>
        <Row type="flex" justify="space-around" class="code-row-bg">
          <Col span="11">
            <FormItem label="创建人：" prop="planStart">
              {{ form1datacopy.createUserName }}
            </FormItem>
          </Col>
          <Col span="11">
            <FormItem label="创建时间：" prop="planEnd">
              {{ form1datacopy.createDate }}
            </FormItem>
          </Col>
        </Row>
      </Form>
      <div slot="footer">
        <Button class='ivu-btn-save' :loading="buttonLoadingSubmit" @click="submit('f1')">确定</Button>
        <Button class='ivu-btn-cancel' @click="handleCancel">取消</Button>
      </div>
    </Modal>
    <Modal title="审计任务信息" v-model="model2" :width=800>
      <Form :model="form1datacopy" :label-width="160">
        <Row type="flex" justify="space-around" class="detail-background-clor">
          <Col span="11">
            <FormItem label="审计任务：" prop="stdOrgName">
              {{ form1datacopy.missionName }}
            </FormItem>
          </Col>

          <Col span="11">
            <FormItem label="审计计划：">
              {{ form1datacopy.auditPlanName }}
            </FormItem>
          </Col>
        </Row>
        <Row type="flex" justify="space-around">
          <Col span="11">
            <FormItem label="审计基础标准：">
              {{ form1datacopy.basicsName }}
            </FormItem>
          </Col>
          <Col span="11">
            <FormItem label="审计现场标准：">
              {{ form1datacopy.sceneName }}
            </FormItem>
          </Col>
        </Row>
        <Row type="flex" justify="space-around">
          <Col span="11">
            <FormItem label="审计班组标准：">
              {{ form1datacopy.teamName }}
            </FormItem>
          </Col>
          <Col span="11">
            <FormItem label="审计类型：" prop="auditType">
              {{ form1datacopy.auditType == '1' ? '专项检查' : '安全审计' }}
            </FormItem>
          </Col>
        </Row>
        <Row type="flex" justify="space-around" class="detail-background-clor">
          <Col span="23">
            <FormItem label="被审计单位：" prop="stdOrgName">
              {{ form1datacopy.auditedOrgName }}
            </FormItem>
          </Col>

        </Row>
        <Row type="flex" justify="space-around" class="detail-background-clor">

          <Col span="11">
            <FormItem label="带队：">
              {{ form1datacopy.supervisor }}
            </FormItem>
          </Col>
          <Col span="11">
            <FormItem label="组长：" prop="location">
              {{ form1datacopy.groupLeaderName }}
            </FormItem>
          </Col>
        </Row>
        <Row type="flex" justify="space-around">
          <Col span="23">
            <FormItem label="组员：">
              {{ form1datacopy.membersName }}
            </FormItem>
          </Col>
        </Row>
        <Row type="flex" justify="space-around" class="detail-background-clor">
          <Col span="11">
            <FormItem label="开始时间：">
              {{ formatDate(new Date(form1datacopy.planStart), 'yyyy-MM-dd') }}
            </FormItem>
          </Col>
          <Col span="11">
            <FormItem label="结束时间：">
              {{ formatDate(new Date(form1datacopy.planEnd), 'yyyy-MM-dd') }}
            </FormItem>
          </Col>

        </Row>
        <Row type="flex" justify="space-around" class="code-row-bg">
          <Col span="11">
            <FormItem label="创建人：" prop="planStart">
              {{ form1datacopy.createUserName }}
            </FormItem>
          </Col>
          <Col span="11">
            <FormItem label="创建时间：" prop="planEnd">
              {{ form1datacopy.createDate }}
            </FormItem>
          </Col>
        </Row>
        <Row type="flex" justify="space-around" class="code-row-bg">
          <Col span="23">
            <FormItem label="审计资料：">
              <div v-show="uploadList.length>0" v-for="item in uploadList" :key='item'>
                <a @click="downloadFile(form1datacopy.missionId,item)">{{ item.fileName }}</a>
              </div>
            </FormItem>
          </Col>
        </Row>
      </Form>
      <div slot="footer">
        <Button class='ivu-btn-save' @click="onCancel">关闭</Button>
      </div>
    </Modal>
    <Modal title="专家选择" :transfer=false footer-hide v-model="expertSelectModal" :width=1000>
      <expertSelect ref="selExpert" :selectUsers=selectUsers @getActivityData="getActivityData"
                    @closeModal1="closeModal1">
      </expertSelect>
    </Modal>
    <Modal title="上传审计资料" :transfer=false v-model="model5" :width=500>
      <Form ref="form1datacopy" :model="form1datacopy" label-position="top">
        <Row type="flex" justify="space-around" class="code-row-bg">
          <Col span="23">
            <FormItem label="审计资料上传：">
              <div>
                <Upload ref="upload"
                        :before-upload="beforeUpload"
                        :show-upload-list="true"
                        :max-size="10240"
                        multiple
                        type="drag"
                        :action="fileUrl">
                  <div style="padding: 10px">
                    <Icon type="ios-cloud-upload" size="45" style="color: #3399ff"></Icon>
                    <p>点击将文件拖拽到这里上传</p>
                    <span style="font-size:8px;color: #797a64">支持扩展名：.rar .zip .doc .docx .pdf...</span>
                  </div>
                </Upload>
              </div>
              <div v-show="uploadList.length>0" v-for="(item,index) in uploadList" :key='item'>
                <a @click="downloadFile(form1datacopy.missionId,item,index)">{{ item.fileName }}</a>
                <Button type="text" icon="md-trash" @click="remove1(item.id)"
                        style="margin-left: 5px;margin-bottom: 3px"/>
                <Progress  v-show="uploadListVisible[index]" :percent="uploadListPercent[index]"></Progress>
              </div>
            </FormItem>
          </Col>
        </Row>
      </Form>
      <div slot="footer">
        <Button class='ivu-btn-save' @click="closeUpload">关闭</Button>
      </div>
    </Modal>
    <Modal title="发送邮件" v-model="model3" :width=800>
      <Form ref="ruleCustom2" :model="formData" :rules="ruleCustom2" label-position="top">
        <Row :gutter="16">
          <i-col span="24">
            <FormItem label="邮件标题：" prop="title">
              <Input type='text' v-model='formData.title'></Input>
            </FormItem>
          </i-col>
        </Row>
        <Row :gutter="16">
          <i-col span="24">
            <FormItem label="邮件正文：" prop="content">
              <Input type='textarea' v-model='formData.content'></Input>
            </FormItem>
          </i-col>
        </Row>
        <Row :gutter="16">
          <i-col span="12">
            <FormItem label="提交资料截止日期：" prop="closingDate">
              <DatePicker v-model="formData.closingDate" type="date" style="width: 100%" format="yyyy-MM-dd"
                          placeholder="请选择资料截止日期"></DatePicker>
            </FormItem>
          </i-col>
        </Row>
        <Row :gutter="16">
          <i-col>
            <Table ref='table3' style="margin-top: 10px" :loading="loading2" border :columns="columns3"
                   no-data-text="没有查询到相关数据！"
                   :data="infos3" width="100%" height="300" highlight-row stripe size="small"></Table>
          </i-col>
        </Row>
      </Form>
      <div slot="footer">
        <Button @click="sendMail" class="ivu-btn-save" :loading="buttonLoading2">发送</Button>
        <Button @click="model3 = false" class="ivu-btn-cancel">取消</Button>
      </div>
    </Modal>
    <Modal title="发送记录" v-model="model4" :width=900>
      <Table ref='table1' height="300" no-data-text="没有查询到相关数据！" :loading="loading3" size="small" border
             :columns="columns4" :data="infos4"></Table>
      <div slot="footer">
        <Button @click="model4 = false" class="ivu-btn-cancel">取消</Button>
      </div>
    </Modal>

    <Modal title="企业负责人选择" :transfer=false footer-hide v-model="modal6" :width=900>
      <userManager :model="true" :companyId="auditOrgId" @getSelectModelData="getSelectModelData">
      </userManager>
    </Modal>
  </Layout>
</template>

<script>
import {Api} from '@/api/index.js'
import {sessionStorage} from '@/common/cacheUtils.js';
import expertSelect from "./expertSelect.vue"
import userManager from '../../base/authorityManager/userManager'

var cascaderDom = () => import('@/components/cascader-dom.vue');

export default {
  components: {
    cascaderDom, expertSelect, userManager
  },
  data() {
    return {
      modal6: false,
      model5: false,
      uploadList: [],
      backLoading: false,
      audit: {},
      auditOrgId: -1,
      uploadListVisible: [],
      uploadListPercent: [],
      planList: [],
      fileUrl: Api.interestedPartiesUserFile,
      buttonLoadingSubmit: false,
      buttonLoading3: false,
      buttonLoading2: false,
      addLoading: false,
      crrentUser: sessionStorage('userId').getObject('userId'),
      curPlan: {},
      teams: [],
      expertSelectModal: false,
      selectUsers: [],
      appStatusList: [],
      currentUser: JSON.parse(sessionStorage('userId').get('userId')),
      locationList: [],
      stdRankList: [],
      supervisors: [],
      downloadUrl: Api.downloadMongoFile,
      upUrl: Api.uploadMongoFile,
      switchFlag: false,
      form1: {},
      pageSizeArray: [10, 20, 50],
      pagedata: {
        total: 0,
        pageSize: 10,
        currentPage: 1,
      },
      dataTable: [],
      roleType:"",
      columns1: [
        {
          type: 'selection',
          width: 60,
          align: 'center',
          fixed: 'left',
        },
        {
          title: "序号",
          width: 80,
          align: "center",
          fixed: 'left',
          render: (h, params) => {
            return h('span', params.index + (this.pagedata.currentPage - 1) * this.pagedata.pageSize + 1);
          }
        },
        {
          title: '审计状态',
          minWidth: 150,
          align: 'center',
          fixed: 'left',
          key: 'missionName',
          render: (h, params) => {
            let color = 'green'
            if (params.row.auditState == '0') {
              color = 'blue';
            }
            return h('span', {
              style: {
                color: color
              }
            }, params.row.auditState == '0' ? '审计中' : '已审计');
          }
        },
        // {
        //   title: '审计任务',
        //   minWidth: 150,
        //   align: 'center',
        //   key: 'missionName',
        // },
        {
          title: '被审计单位',
          minWidth: 280,
          align: 'center',
          fixed: 'left',
          key: 'auditedOrgName',
        },
        {
          title: '审计类型',
          minWidth: 100,
          align: 'center',
          key: 'auditType',
          render: (h, params) => {
            return h('div', params.row.auditType == '1' ? '专项检查' : '安全审计');
          }
        },
        {
          title: '审计基础标准',
          minWidth: 150,
          align: 'center',
          key: 'basicsName',
          render: (h, params) => {
            return h('div', [
              h('span', params.row.basicsName || '--')
            ]);
          }
        },
        {
          title: '审计现场标准',
          minWidth: 150,
          align: 'center',
          key: 'sceneName',
          render: (h, params) => {
            return h('div', [
              h('span', params.row.sceneName || '--')
            ]);
          }
        },
        {
          title: '审计班组标准',
          minWidth: 150,
          align: 'center',
          key: 'teamName',
          render: (h, params) => {
            return h('div', [
              h('span', params.row.teamName || '--')
            ]);
          }
        },
        {
          title: '组长',
          minWidth: 80,
          align: 'center',
          key: 'groupLeaderName',
        },

        {
          title: '开始时间',
          minWidth: 120,
          align: 'center',
          sortable: "custom",
          key: 'planStart',
          render: (h, params) => {
            return h('div', [
              (this.formatDate(new Date(params.row.planStart), 'yyyy-MM-dd'))
            ]);
          }
        },
        {
          title: '结束时间',
          minWidth: 120,
          align: 'center',
          sortable: "custom",
          key: 'planEnd',
          render: (h, params) => {
            return h('div', [
              (this.formatDate(new Date(params.row.planEnd), 'yyyy-MM-dd'))
            ]);
          }
        },

        {
          title: '成员',
          minWidth: 300,
          align: 'center',
          key: 'membersName',
        },
        {
          title: '操作',
          key: 'action',
          fixed: 'right',
          minWidth: 220,
          align: 'center',
          render: (h, params) => {
            if (params.row.auditState == '0') {
              if (this.currentUser.loginId === this.Common.admin || this.currentUser.userId === params.row.createUserId || this.currentUser.userRole.find(obj => obj.roleId == '73b38b37dff64392ba0ee7dd579bf293') != undefined || params.row.groupLeaderUserId == params.row.createUserId || params.row.membersId.search(params.row.createUserId) || params.row.createUserId == params.row.supervisorId) {
                return h('div', [
                  h('A', {
                    props: {
                      type: 'primary',
                      size: 'small'
                    },
                    style: {
                      fontSize: '14px'
                    },
                    on: {
                      click: () => {
                          this.$router.push({path: '/aduitBright', query: {missionId:params.row.missionId}});

                      }
                    }
                  }, '审计亮点'),
                  h('Divider', {
                    props: {
                      type: 'vertical',
                    }
                  }, ''),
                  h('A', {
                    props: {
                      type: 'primary',
                      size: 'small'
                    },
                    style: {
                      fontSize: '14px'
                    },
                    on: {
                      click: () => {

                        if (params.row.basicsId && params.row.sceneId && params.row.teamId) {
                          let data = {
                            roleType:this.roleType,
                          }
                          data = Object.assign(data, JSON.parse(JSON.stringify(params.row)));
                          this.$router.push({path: '/problemList', query: data});
                        } else {
                          this.$Message.warning("请先选择审计标准");
                        }
                        // this.$router.push({path:'/problemBase',query:params.row});
                      }
                    }
                  }, '问题清单'),
                  h('Divider', {
                    props: {
                      type: 'vertical',
                    }
                  }, ''),
                  h('A', {
                    props: {
                      type: 'primary',
                      size: 'small'
                    },
                    style: {
                      fontSize: '14px'
                    },
                    on: {
                      click: () => {
                        this.showData(params, 1);
                      }
                    }
                  }, '详情'),

                  h('A', {
                    props: {
                      type: 'primary',
                      size: 'small'
                    },
                    style: {
                      fontSize: '14px'
                    },
                    on: {
                      click: () => {
                        this.showFiles(params);

                      }
                    }
                  }, '资料上传'),
                  h('Divider', {
                    props: {
                      type: 'vertical',
                    }
                  }, ''),
                  h('A', {
                    props: {
                      type: 'primary',
                      size: 'small'
                    },
                    style: {
                      fontSize: '14px'
                    },
                    on: {
                      click: () => {
                        let _this = this;
                        let config = {
                          title: '系统提示',
                          content: '是否通知企业负责人签收?',
                          okText: '是',
                          cancelText: '否',
                          onOk() {
                            _this.auditOrgId = params.row.auditedOrgId;
                            _this.audit = params.row;
                            _this.modal6 = true;
                          },
                          onCancel() {
                            setTimeout(() => {
                              _this.auditOrgId = params.row.auditedOrgId;
                              _this.audit = params.row;
                              _this.submitReportSelect(null);
                            }, 500);

                          }

                        }
                        this.$Modal.confirm(config);

                        //this.submitReportSelect(params.row);

                      }
                    }
                  }, '完成审计'),
                  h('Divider', {
                    props: {
                      type: 'vertical',
                    }
                  }, ''),
                  h('A', {
                    props: {
                      type: 'primary',
                      size: 'small'
                    },
                    style: {
                      fontSize: '14px'
                    },
                    on: {
                      click: () => {
                        this.showData(params, 2);
                      }
                    }
                  }, '绑定'),
                ]);
              } else {
                return h('div', [
                  h('A', {
                    props: {
                      type: 'primary',
                      size: 'small'
                    },
                    style: {
                      fontSize: '14px'
                    },
                    on: {
                      click: () => {
                        this.$router.push({path: '/aduitBright', query: {missionId:params.row.missionId}});

                      }
                    }
                  }, '审计亮点'),
                  h('Divider', {
                    props: {
                      type: 'vertical',
                    }
                  }, ''),
                  h('A', {
                    props: {
                      type: 'primary',
                      size: 'small'
                    },
                    style: {
                      fontSize: '14px'
                    },
                    on: {
                      click: () => {
                        let data = {
                          roleType:this.roleType,
                        }
                        data = Object.assign(data, JSON.parse(JSON.stringify(params.row)));
                        this.$router.push({path: '/problemListView', query: data});
                      }
                    }
                  }, '问题清单'),
                  h('Divider', {
                    props: {
                      type: 'vertical',
                    }
                  }, ''),
                  h('A', {
                    props: {
                      type: 'primary',
                      size: 'small'
                    },
                    style: {
                      fontSize: '14px'
                    },
                    on: {
                      click: () => {
                        this.showData(params, 1);
                      }
                    }
                  }, '详情'),

                  h('Divider', {
                    props: {
                      type: 'vertical',
                    }
                  }, ''),
                  h('A', {
                    props: {
                      type: 'primary',
                      size: 'small'
                    },
                    style: {
                      fontSize: '14px'
                    },
                    on: {
                      click: () => {
                        this.showFiles(params);

                      }
                    }
                  }, '资料上传'),
                  h('Divider', {
                    props: {
                      type: 'vertical',
                    }
                  }, ''),
                  h('A', {
                    props: {type: 'primary', size: 'small'},
                    style: {fontSize: '14px', color: '#c5c8ce', pointerEvents: 'none'},
                  }, '完成审计'),
                  h('Divider', {
                    props: {
                      type: 'vertical',
                    }
                  }, ''),
                  h('A', {
                    props: {type: 'primary', size: 'small'},
                    style: {fontSize: '14px', color: '#c5c8ce', pointerEvents: 'none'},
                  }, '绑定'),

                ]);
              }
            } else {
              return h('div', [
                h('A', {
                  props: {
                    type: 'primary',
                    size: 'small'
                  },
                  style: {
                    fontSize: '14px'
                  },
                  on: {
                    click: () => {
                      this.$router.push({path: '/aduitBright', query: {missionId:params.row.missionId}});

                    }
                  }
                }, '审计亮点'),
                h('Divider', {
                  props: {
                    type: 'vertical',
                  }
                }, ''),
                h('A', {
                  props: {
                    type: 'primary',
                    size: 'small'
                  },
                  style: {
                    fontSize: '14px'
                  },
                  on: {
                    click: () => {
                      let data = {
                        roleType:this.roleType,
                      }
                      data = Object.assign(data, JSON.parse(JSON.stringify(params.row)));
                      this.$router.push({path: '/problemListView', query: data});
                    }
                  }
                }, '问题清单'),
                h('Divider', {
                  props: {
                    type: 'vertical',
                  }
                }, ''),
                h('A', {
                  props: {
                    type: 'primary',
                    size: 'small'
                  },
                  style: {
                    fontSize: '14px'
                  },
                  on: {
                    click: () => {
                      this.showData(params, 1);
                    }
                  }
                }, '详情'),

                h('A', {
                  props: {
                    type: 'primary',
                    size: 'small'
                  },
                  style: {
                    fontSize: '14px'
                  },
                  on: {
                    click: () => {
                      this.showFiles(params);

                    }
                  }
                }, '资料上传'),
                h('Divider', {
                  props: {
                    type: 'vertical',
                  }
                }, ''),
                h('A', {
                  props: {type: 'primary', size: 'small'},
                  style: {fontSize: '14px', color: '#c5c8ce', pointerEvents: 'none'},
                }, '完成审计'),
                h('Divider', {
                  props: {
                    type: 'vertical',
                  }
                }, ''),
                h('A', {
                  props: {type: 'primary', size: 'small'},
                  style: {fontSize: '14px', color: '#c5c8ce', pointerEvents: 'none'},
                }, '绑定'),
              ]);
            }

          }
        },

      ],
      ruleCustom: {
        missionName: [{
          required: true,
          message: '  ',
          trigger: 'change'
        }],
        supervisorId: [
          {required: true, message: '  ', trigger: 'blur'}
        ],

        auditTypeId: [{
          validator: (rule, value, callback) => {
            if (this.form1datacopy.auditTypeId == null || this.form1datacopy.auditTypeId == '' || this.form1datacopy.auditTypeId == undefined) {
              callback(' ')
            } else {
              callback()
            }
          },
          required: true,
          trigger: 'change'
        }],
        teamId: [{
          validator: (rule, value, callback) => {
            if (this.form1datacopy.teamId == null || this.form1datacopy.teamId == '' || this.form1datacopy.teamId == undefined) {
              callback(' ')
            } else {
              callback()
            }
          },
          required: true,
          trigger: 'change'
        }],
        sceneId: [{
          validator: (rule, value, callback) => {
            if (this.form1datacopy.sceneId == null || this.form1datacopy.sceneId == '' || this.form1datacopy.sceneId == undefined) {
              callback(' ')
            } else {
              callback()
            }
          },
          required: true,
          trigger: 'change'
        }],
        basicsId: [{
          validator: (rule, value, callback) => {
            if (this.form1datacopy.basicsId == null || this.form1datacopy.basicsId == '' || this.form1datacopy.basicsId == undefined) {
              callback(' ')
            } else {
              callback()
            }
          },
          required: true,
          trigger: 'change'
        }],
        auditedOrgId: [
          {required: true, message: '  ', trigger: 'change'}
        ],
        locationId: [
          {required: true, message: '  ', trigger: 'change'}
        ],
        stdRankId: [
          {required: true, message: '  ', trigger: 'change'}
        ],
        groupLeaderName: [
          {required: true, message: '  ', trigger: 'change'}
        ],
        membersName: [
          {required: true, message: '  ', trigger: 'change'}
        ],
        cover: [
          {required: true, message: '  ', trigger: 'change'}
        ],

        planEnd: [{
          validator: (rule, value, callback) => {
            if (value == null || value == '' || value == undefined) {
              callback(' ')
            } else {
              callback()
            }
          },
          required: true,
          trigger: 'change'
        }],
        planStart: [{
          validator: (rule, value, callback) => {
            if (value == null || value == '' || value == undefined) {
              callback(' ')
            } else {
              callback()
            }
          },
          required: true,
          trigger: 'change'
        }],
      },
      auditedOrgName: '',
      auditedOrgId: '',
      basics: [],
      basicsMap: {},
      reportSelectAll: [],
      scene: [],
      sceneMap: {},
      add: false,
      model1: false,
      model2: false,
      model3: false,
      model4: false,
      showdata: {},
      location: null,
      form1datacopy: {},
      files: [],
      buttonLoading: false, tableHeight: 10,
      ruleCustom2: {
        title: [
          {
            required: true,
            message: '  ',
            trigger: 'change, blur'
          }
        ],
        content: [
          {
            required: true,
            message: '  ',
            trigger: 'change, blur'
          }
        ],
        closingDate: [
          {
            required: true,
            type: 'date',
            message: '  ',
            trigger: 'change, blur'
          }
        ]
      },
      formData: {},
      columns3: [
        {
          type: 'index',
          title: '序号',
          width: 80,
          align: 'center',
          fixed: 'left',
        },
        {
          title: '企业名称',
          align: 'center',
          key: 'companyName',
          minWidth: 200,
          render: (h, params) => {
            return h('div', [
              h('span', params.row.companyName || '--')
            ]);
          }
        },
        {
          title: '企业邮箱',
          align: 'center',
          key: 'officeMail',
          minWidth: 200,
          render: (h, params) => {
            return h('div', [
              h('span', params.row.officeMail || '--')
            ]);
          }
        },
        {
          title: '附件类型',
          align: 'center',
          key: 'twoCompanyName',
          minWidth: 200,
          render: (h, params) => {
            return h('div', [
              h('span', params.row.twoCompanyName || '--')
            ]);
          }
        },
      ],
      infos3: [],
      selectList: [],
      loading2: false,
      loading3: false,
      columns4: [
        {
          type: 'index',
          title: '序号',
          width: 80,
          align: 'center',
          fixed: 'left',
        },
        {
          title: '发送时间',
          align: 'center',
          key: 'createDate',
          minWidth: 200,
          render: (h, params) => {
            return h('div', [
              h('span', this.formatDate(new Date(params.row.createDate), 'yyyy-MM-dd hh:mm:ss') || '--')
            ]);
          }
        },
        {
          title: '发送人',
          align: 'center',
          key: 'userName',
          minWidth: 100,
          render: (h, params) => {
            return h('div', [
              h('span', params.row.userName || '--')
            ]);
          }
        },
        {
          title: '邮件主题',
          align: 'center',
          key: 'title',
          minWidth: 150,
          render: (h, params) => {
            return h('div', [
              h('span', params.row.title || '--')
            ]);
          }
        },
        {
          title: '邮件正文',
          align: 'center',
          key: 'content',
          minWidth: 250,
          render: (h, params) => {
            return h('div', [
              h('span', params.row.content || '--')
            ]);
          }
        },
        {
          title: '提交资料截止日期',
          align: 'center',
          key: 'closingDate',
          minWidth: 150,
          render: (h, params) => {
            return h('div', [
              h('span', this.formatDate(new Date(params.row.closingDate), 'yyyy-MM-dd') || '--')
            ]);
          }
        },
      ],
      infos4: [],
    }
  },
  mounted() {
    console.log(this.crrentUser)
    this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 145;
    this.selectCodingSort();
    this.getPlanAll();

  },
  methods: {
    sortChange(data) {
      if (data.order === 'asc' || data.order === 'desc') {
        let order = data.key
        this.form1.dynamicSort = order + ' ' + data.order
        this.query()
      }
    },
    rollback() {
      if (this.reportSelectAll.length == 0) {
        this.$Message.warning("请至少勾选一条记录")
      } else {
        this.buttonLoading = true;
        this.$http.post(Api.auditRollBack, this.reportSelectAll).then((res) => {
          if (res.data.status == '200') {
            this.$Message.success("退回成功")
            this.query();
          } else {
            this.$Message.error(res.data.msg)
            this.query();
          }
        }).catch(e => {
          this.buttonLoading = false;
          this.$Message.error("退回失败")
        })
      }


    },
    getSelectModelData(row) {
      // this.dataToExtension.userId = row.value;
      // this.dataToExtension.userName = row.label;
      this.submitReportSelect(row.userId)
    },
    getPlanAll() {
      let _this = this;
      this.buttonLoading = true;
      this.$http.get(Api.getPlanAll).then((res) => {

        _this.planList = res.data.data.list
        _this.planList.forEach(item => {
          if (item["now"]) {
            _this.form1.auditPlanId = item.auditPlanId;
          }

        })
        this.query();
      }).catch(e => {
        this.$Message.error("数据获取失败")
      })
    },
    async showFiles(params) {
      this.form1datacopy = JSON.parse(JSON.stringify(params.row));
      await this.getFiles();
      this.model5 = true;
    },
    closeUpload() {
      this.upLoadList = [];
      this.model5 = false;
    },
    downloadFile(guideId, file,index) {
      let url = this.fileUrl + '/file/' + file.id;
      this.uploadListVisible[index] = true;
      var _this = this;
      this.$http.get(url, {
        responseType: 'blob',      //告诉服务器我们需要的响应格式
        progress:function(e){
            _this.$set(_this.uploadListPercent,index, 100 * (e.loaded / e.total));
        }
      }).then((res) => {
        console.log(res)
        const aLink = document.createElement("a");
        let blob = new Blob([res.data], {
          type: res.bodyBlob.type      //将会被放入到blob中的数组内容的MIME类型
        });
        aLink.href = URL.createObjectURL(blob)
        aLink.download = file.fileName //标题
        aLink.click()
        document.body.appendChild(aLink)
      })
    },
    remove1(id) {
      let url = this.fileUrl + '/file/' + id;
      this.$http.delete(url).then((res) => {
        this.getFiles()
      })
    },
    async getFiles() {
      this.uploadList = [];
      let url = this.fileUrl + '/' + this.form1datacopy.missionId + '/files/missionFile'
      await this.$http.get(url).then((res) => {
        if (res.data.result == "success") {
          this.uploadList = res.data.data;
          var index = 0;
          this.uploadList.forEach(item=>{
            this.uploadListPercent[index]=0;
            this.uploadListVisible[index] = false;
            index++;
          })
        }
      })
    },
    beforeUpload(file) {
      let formData = new FormData();
      formData.append("files", file); // 文件对象
      let url = this.fileUrl + '/' + this.form1datacopy.missionId + '/files/missionFile'
      this.$http.post(url, formData).then((res) => {
        if (res.data.result == "success") {
          this.$Message.info("文件上传成功")
          this.getFiles();
        }
      });
      return false
    },
    rectLeaderChange(appStatus) {
      if (appStatus) {
        this.form1datacopy.supervisorId = appStatus.value;
        this.form1datacopy.supervisor = appStatus.label;
      }
    },
    auditTypesChange(stdRank) {
      if (stdRank) {
        this.form1datacopy.auditTypeId = stdRank.value;
        this.form1datacopy.auditTypeName = stdRank.label;
      }
    },
    openExpertSelector(isLeader) {
      this.$refs.selExpert.isLeader = isLeader
      this.$refs.selExpert.form2 = {
        members: this.form1datacopy.membersName ? this.form1datacopy.membersName : '',
        membersId: '',
        membersUserId: ''
      },

          //console.log('1111',this.form1datacopy)
          this.selectUsers = []
      let hasVal = this.form1datacopy.membersId && this.form1datacopy.membersId.length > 1
      let mId = hasVal ? this.form1datacopy.membersId.split(',') : []
      let mName = hasVal ? this.form1datacopy.membersName.split(',') : []
      let mUId = hasVal ? this.form1datacopy.membersUserId.split(',') : []
      let i = 0
      mId.forEach(v => {
        let userInfo = {name: mName[i], expertId: v, userId: mUId[i]}
        i++
        this.selectUsers.push(userInfo)
      })

      this.expertSelectModal = true;
    },
    onCancel() {
      this.model2 = false
    },
    closeModal1() {
      this.expertSelectModal = false;
      this.selectUsers = []
    },
    getActivityData(row) {
      console.log('getActivityData(row)', row)
      if (this.$refs.selExpert.isLeader == 1) {
        this.form1datacopy.groupLeaderId = row.expertId;
        this.form1datacopy.groupLeaderName = row.userName;
        this.form1datacopy.groupLeaderUserId = row.userId;
        this.expertSelectModal = false;
      } else {
        this.form1datacopy.membersId = row.membersId.join(',')
        this.form1datacopy.membersName = row.members.join(',')
        this.form1datacopy.membersUserId = row.membersUserId.join(',')
      }
    },

    selectLocation(location) {
      this.form1datacopy.locationId = location.value;
      this.form1datacopy.location = location.label;
    },
    selectstdRank(stdRank) {
      this.form1datacopy.stdRankId = stdRank.value;
      this.form1datacopy.stdRank = stdRank.label;
    },
    selectAppStatus(appStatus) {
      this.form1datacopy.appStatusId = appStatus.value;
      this.form1datacopy.appStatus = appStatus.label;
    },
    reportSelect(select) {
      this.reportSelectAll = [];
      select.forEach(item => {
        this.reportSelectAll.push(item.missionId)
      });
      console.log(this.reportSelectAll)
    },
    beforeUploadOther(file) {
      this.files.push(file);

      return false;
    },
    submitReportSelect(userId) {
      let _this = this;
      let config = {
        title: '系统提示',
        content: '完成审计后问题不可修改，是否确定完成审计?',
        okText: '确定',
        cancelText: '取消',
        onOk: function () {
          _this.modal6 = false;
          _this.buttonLoading = true;
          let data = {
            userId: sessionStorage('userId').getObject('userId').userId,
            userName: sessionStorage('userId').getObject('userId').userName,
            missionId: _this.audit.missionId,
          }
          if (userId) {
            data.auditUserId = userId;
          }
          this.$http.post(Api.submitSelectAdtMission, data).then((res) => {
            _this.buttonLoading = false;
            if (res.data.status == '200') {
              _this.$Message.success("确认成功");
              _this.query();
            } else {
              _this.$Message.warning(res.data.msg);
              _this.query();
            }

            }).catch(e => {
              _this.buttonLoading = false;
              this.query();
              this.$Message.error("失败")
            })

          }

        }
        this.$Modal.confirm(config);


    },
    deleteFile(index) {
      this.files.splice(index, 1);
    },
    setOrgId(data) {
      this.form1datacopy.auditedOrgId = data[data.length - 1];
    },
    setOrgName(data) {
      this.form1datacopy.auditedOrgName = data;
    },
    deleteData(params) {
      this.$Modal.confirm({
        title: '数据删除',
        content: '<p>确定删除该条信息</p>',
        okText: '确认',
        onOk: () => {
          let url = Api.deleteAdtMission;
          this.$http.get(url, {params: {id: params.row.missionId}}).then((res) => {
            if (res.status === 200) {
              this.$Message.success('成功');
              this.query()
            } else if (res.data.status === 201) {
              this.$Message.error(res.data.msg);

            }
          }).catch(e => {
            this.$Message.error('请求失败' + e);
          })
        },
        cancelText: '取消'
      });
    },


    getSelectRows(rows) {
      this.deleteRows = rows;
    },
    batDelete() {

    },
    addInfo() {
      let userName = JSON.parse(sessionStorage('paramUserInfo').get('userInfo'))["createUserName"]
      this.form1datacopy = {
        createDate: this.formatDate(new Date(), 'yyyy-MM-dd'),
        createUserName: userName,
        auditPlanName: this.curPlan.auditPlanName,
        auditPlanId: this.curPlan.auditPlanId,
        planStartTime: this.curPlan.planStartTime,
        planEndTime: this.curPlan.planEndTime
      };
      this.auditedOrgName = '';
      this.auditedOrgId = '';
      this.model1 = true;
      this.add = true;
    },
    pageChange(pageNum) {
      this.pagedata.currentPage = pageNum;
      this.query();
    },
    pageSizeChange(pageSize) {
      this.pagedata.pageSize = pageSize;
      this.query();
    },
    handleCancel() {
      this.form1datacopy = {};
      this.model1 = false;
    },
    forMap(arr) {
      let map = {};
      arr.forEach(item => {
        map[item["id"]] = item["standardsName"]
      })
      return map;
    },
    selectCodingSort() {
      this.$http.get(Api.getAuditSupervisor).then((res) => {
        this.supervisors = res.data.data;
      });
    },
    async queryStandards(companyId, auditPlanId) {
      await this.$http.get(Api.selectAuditStandardsTreeList, {
        params: {
          type: '1',
          companyId: companyId,
          auditPlanId: auditPlanId
        }
      }).then((res) => {
        this.basics = res.data.data;
        this.basicsMap = this.forMap(this.basics);

      });
      await this.$http.get(Api.selectAuditStandardsTreeList, {
        params: {
          type: '2',
          companyId: companyId,
          auditPlanId: auditPlanId
        }
      }).then((res) => {
        this.scene = res.data.data;
        this.sceneMap = this.forMap(this.scene);
      });

      await this.$http.get(Api.selectAuditStandardsTreeList, {
        params: {
          type: '3',
          companyId: companyId,
          auditPlanId: auditPlanId
        }
      }).then((res) => {
        this.teams = res.data.data;
      });
    },
    switchQuery(flag) {
      this.switchFlag = flag;
      if (!this.switchFlag) {
        this.tableHeight = window.innerHeight - 220;
      } else {
        this.tableHeight = window.innerHeight - 315;
      }
    },
    reset() {
      this.form1 = {};

      this.query();


    },
    query() {
      this.buttonLoading = true;
      let userId = sessionStorage('userId').getObject('userId').userId;
      let orgId = sessionStorage('userId').getObject('userId').companyId;
      let role = "";
      let userRole = sessionStorage('userId').getObject('userId').userRole
      userRole.forEach(item => {
        role += item.roleId + ",";
      })

      let data = {
        currentPage: this.pagedata.currentPage,
        size: this.pagedata.pageSize,
        createOrgId: orgId,
        createUserId: userId,
        role: role
      };
      data = Object.assign(data, JSON.parse(JSON.stringify(this.form1)));
      data.groupLeaderName = this.form1.groupLeaderName || ''
      let url = Api.queryAdtMission;
      this.$http.get(url, {params: data}).then((res) => {
        this.curPlan = res.data.plan
        this.dataTable = res.data.data;
        this.roleType = res.data.roleType;
        this.pagedata.total = res.data.totalSize;
        this.buttonLoading = false
        this.reportSelectAll = [];
        this.dataTable.forEach(item => {
          if (item.auditState == '0') {
            item['_disabled'] = true;
          }
        })
      }).catch(e => {
        this.$Message.error("数据获取失败")
      })
    },
    async showData(data, flag) {
      this.auditedOrgId = data.row.auditedOrgId;
      this.auditedOrgName = data.row.auditedOrgName;
      data.row.createDate = this.formatDate(new Date(data.row.createDate), 'yyyy-MM-dd')
      if (flag == 1) {
        //查看页面
        this.form1datacopy = data.row;
        await this.getFiles();
        this.model2 = true;
      } else {
        //修改页面
        this.add = false;
        await this.queryStandards(data.row.auditedOrgId, data.row.auditPlanId);
        this.form1datacopy = JSON.parse(JSON.stringify(data.row));
        this.model1 = true;
      }
    },
    formatDate(date, fmt) {
      if (/(y+)/.test(fmt)) {
        fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
      }
      let o = {
        'M+': date.getMonth() + 1,
        'd+': date.getDate(),
        'h+': date.getHours(),
        'm+': date.getMinutes(),
        's+': date.getSeconds()
      };
      for (let k in o) {
        if (new RegExp(`(${k})`).test(fmt)) {
          let str = o[k] + '';
          fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? str : this.padLeftZero(str));
        }
      }
      return fmt;
    },

    submit(name) {
      this.$refs[name].validate((valid) => {
        if (valid) {
          this.form1datacopy.planStart = this.formatDate(new Date(this.form1datacopy.planStart), 'yyyy-MM-dd');
          this.form1datacopy.planEnd = this.formatDate(new Date(this.form1datacopy.planEnd), 'yyyy-MM-dd');
          this.buttonLoadingSubmit = true;
          if (this.add) {
            let userId = JSON.parse(sessionStorage('paramUserInfo').get('userInfo'))["createUserId"]
            let orgId = sessionStorage('userId').getObject('userId').orgInfo.orgId;
            this.form1datacopy.createUserId = userId;
            this.form1datacopy.createOrgId = orgId;
            this.$http.post(Api.createAdtMission, this.form1datacopy).then((res) => {
              this.buttonLoadingSubmit = false;
              if (res.status === 200) {
                this.$Message.success('保存成功');
                this.model1 = false;
                this.query()

              } else if (res.data.status === 201) {
                this.$Message.error(res.data.msg);
                this.model1 = false;
              }

            }).catch(e => {
              this.buttonLoadingSubmit = false;
              this.model1 = false;
              this.query();
              this.$Message.error("数据获取失败")
            })
          } else {
            let userId = sessionStorage('userId').getObject('userId').userId;
            let orgId = sessionStorage('userId').getObject('userId').orgInfo.orgId;
            this.form1datacopy.updateUserId = userId;
            this.form1datacopy.updateOrgId = orgId;
            this.$http.post(Api.createAdtMission, this.form1datacopy).then((res) => {
              this.buttonLoadingSubmit = false;
              if (res.status === 200) {
                this.$Message.success("保存成功");
                this.model1 = false;
                this.query()

              } else if (res.data.status === 201) {
                this.$Message.error(res.data.msg);
                this.model1 = false;
              }


            }).catch(e => {
              this.buttonLoadingSubmit = false;
              this.model1 = false;
              this.query();
              this.$Message.error("数据获取失败")
            })
          }


        } else {
          this.$Message.error('请填报完整!');
        }
      }).catch()
    },
    padLeftZero(str) {
      return ('00' + str).substr(str.length);
    },
    openMail(row) {
      let userId = row.groupLeaderId + ',' + row.membersUserId;
      let orgId = row.auditedOrgId;
      this.$set(this.formData, 'workId', row.missionId);
      this.$set(this.formData, 'inspectionUnit', row.auditedOrgName);
      this.$set(this.formData, 'groupLeaderName', row.groupLeaderName);
      this.$set(this.formData, 'groupLeaderId', row.groupLeaderUserId);
      this.$set(this.formData, 'groupMeetsId', row.membersUserId);
      this.$set(this.formData, 'startDate', row.planStart);
      this.$set(this.formData, 'endDate', row.planEnd);
      alert(row.groupLeaderId);
      this.$http.get(Api.queryMail, {
        params: {orgId: orgId, userId: userId, leaderUserId: row.groupLeaderId}
      }).then(function (res) {
        if (res.data.status == 200) {
          if (res.data.data.length == 0) {
            this.$Notice.warning({
              title: '未找到相关机构邮箱！',
              desc: '请检查邮箱管理！'
            });
          } else {
            this.infos3 = res.data.data;
          }
        } else {
          this.$Message.error('查询失败');
        }
      }, function (res) {
        this.$Message.error('请求失败');
        this.loading = false;
      });
      this.model3 = true;
    },
    sendMail() {
      this.$refs['ruleCustom2'].validate((valid) => {
        if (valid) {
          this.formData.configList = this.infos3;
          this.buttonLoading2 = true;
          this.$http.post(Api.sendMail, this.formData).then(function (response) {
            this.buttonLoading2 = false;
            if (response.data.status == 200) {
              this.model3 = false;
              this.$Message.success({content: '发送成功', duration: 4});
            } else {
              this.$Message.error({content: '发送失败，请联系管理员！', duration: 4});
            }
          });
        }
      });
    },
    openMailHistory(row) {
      this.model4 = true;
      this.loading3 = true;
      this.$http.get(Api.sendMail + '/history', {params: {workId: row.missionId}}).then(function (res) {
        this.infos4 = res.data;
        this.loading3 = false;
      }, function (res) {
        this.$Message.error('请求失败');
        this.loading3 = false;
      });
    }
  },
  watch: {
    "model1": function (qw, er) {
      if (qw && this.model1) {
        setTimeout(() => {
          this.$refs.trainOrg.setCurrentOrg();

        }, 100)
      } else {
        this.$refs.trainOrg.setCurrentOrg();

      }
    },

    "expertSelectModal": function (qw, er) {
      if (qw && this.model1) {
        setTimeout(() => {
          //this.$refs.trainOrg.setCurrentOrg();

        }, 100)
      } else {
        this.$refs.selExpert.reset();

      }
    },
    "model3": function (qw, er) {
      if (!qw) {
        this.formData = {};
        this.infos3 = [];
      }
    },
  },


}
</script>

<style lang='css' scoped>
@import '../../../index.css';
</style>
